﻿@model IEnumerable<KhuyenMaiVang.DAL.Voucher>

@{
    ViewBag.Title = "Danh sách voucher";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}

@section heading{Danh sách voucher}

<p>
    @Html.ActionLink("Thêm voucher", "Create")
</p>
<table>
    <thead>
    <tr>
        <th>
            Tên voucher
        </th>
        <th>
            Ngày khởi tạo
        </th>
        <th>
            Thời gian kết thúc
        </th>
        <th>
            Trạng thái
        </th>
        <th>
            Thành phố
        </th>
        <th>
            Chuyên mục
        </th>
        <th>
            Doanh nghiệp
        </th>
        <th></th>
    </tr>
    </thead><tbody>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreatedTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EndTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.VoucherStatusID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.City.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Category.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Business.MangerName)
        </td>
        <td>
            @Html.ImageLink("Address", Url.Content("~/Content/areas/admin/resources/images/icons/map.png"), "Xem địa chỉ", new { id = item.ID })
            @Html.ImageLink("Pictures", Url.Content("~/Content/areas/admin/resources/images/icons/ic_pic.png"), "Xem", new { id = item.ID })
            @Html.ImageLink("Details", Url.Content("~/Content/areas/admin/resources/images/icons/view.png"), "Xem", new { id = item.ID })
            @Html.ImageLink("Change", Url.Content("~/Content/areas/admin/resources/images/icons/change.png"), "Đổi trạng thái", new { id = item.ID })
            @Html.ImageLink("Edit", Url.Content("~/Content/areas/admin/resources/images/icons/pencil.png"), "Sửa", new{id=item.ID})
            @Html.ImageLink("Delete", Url.Content("~/Content/areas/admin/resources/images/icons/cross.png"), "Xóa", new{id=item.ID})
        </td>
    </tr>
}
</tbody>
</table>
